/*
 *  ErrorCodes.cpp
 *  vorpal
 *
 *  Created by rwebb on 25/08/09.
 *
 */

#include "ErrorCodes.h"

static const char *error_strings[NUM_ERROR_CODES] = {
	"NONE",
	"ASSERT_FAILED",
	"CONFIRM_FAILED",
	"REQUIRE_FAILED",
	"INVALID_NUM_ARGS",
	"INVALID_ARG_TYPES",
	"SETTING_SLOT_OF_TRUE_FALSE_NONE",
	"KEY_MISSING",
	"INVALID_DATATYPE",
	"INVALID_DELTA_FILL",
	"ILLEGAL_RECURSION",
	"OBJ_CANNOT_COPYOF",
	"OBJ_CANNOT_USE_SLOTS",
	"OBJ_CANNOT_CLONE",
	"OBJ_CANNOT_TONUMBER",
	"DUPLICATE_LABEL",
	"INVALID_MESSAGE_PASSED",
	"JUMPS_MISSING_LABEL",
	"TOKEN_MATCHED_NO_RULES",
	"FILE_OPEN_FAILED",
	"FILE_READ",
	"FILE_WRITE",
	"FILE_INVALID_MODE",
	"FILE_LOAD",
	"EVENT_INVALID_ATTACHMENT",
	"EVENT_NO_RECEIVE",
	"EVENT_DEST_DOES_NOT_EXIST",
	"EVENT_NOT_ALLOWED",
};

const char *ErrorString(uint errorCode){
	Assert(errorCode < NUM_ERROR_CODES);
	return error_strings[errorCode];
}
